#include "FlipProcessorProcessor.h"

FlipProcessorProcessor::FlipProcessorProcessor(int w, int h)
{
    VerticalFlip = 1.0;
    HorizontalFlip = 1.0;
    iWidth = w;
    iHeight = h;

}

void FlipProcessorProcessor::apply(){

    if (HorizontalFlip == -1){
         glRasterPos2i(iWidth, 0);
        glPixelZoom(-1.0f, 1.0f);

    }
    if (VerticalFlip == -1){
        glRasterPos2i(0, iHeight);
        glPixelZoom(1.0f, -1.0f);

    }


}


void FlipProcessorProcessor::setHorizontalFlip(bool set)
{
    if (set){
        VerticalFlip = 1.0;
        HorizontalFlip = -1.0;
    }
    else{
     //   VerticalFlip = -1.0;
        HorizontalFlip = 1.0;
    }
}

void FlipProcessorProcessor::setVerticalFlip(bool set)
{
    if (set){
        HorizontalFlip = 1.0;
        VerticalFlip = -1.0;
    }
    else
        VerticalFlip = 1.0;
}
